class Solution:
    def twoSum(self, nums, target):
        dict = {}
        for i in range(len(nums)):
            if (target - nums[i]) in dict:
                return [dict.get(target - nums[i]),i]
            dict[nums[i]] = i
        # print(dict)
nums = [2, 7, 11, 15]
target = 9
print(Solution().twoSum(nums,target))